<template>
  <div>
    <div
      v-for="(item, index) in wallet.desktop?.instructions?.steps"
      :key="index"
      style="display: flex; gap: 16px; max-width: 320px; margin: 0 auto; padding: 32px 0 0 0"
    >
      <img
        v-if="item.step === 'install'"
        style="width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0"
        :src="wallet.icon ?? wallet.iconUrl"
      />
      <Create v-if="item.step === 'create'" style="width: 44px; height: 44px; flex-shrink: 0" />
      <Connect v-if="item.step === 'connect'" style="width: 44px; height: 44px; flex-shrink: 0" />
      <div style="font-size: 14px; line-height: 18px; display: flex; flex-direction: column; max-width: 256px">
        <div style="font-weight: bold; margin-bottom: 4px; word-break: break-word">{{ item.title }}</div>
        <div style="color: #ffffff99; word-break: break-word">{{ item.description }}</div>
      </div>
    </div>
    <button
      style="margin: 16px auto; margin-top: 32px; display: block"
      @click="
        () => {
          emits('connect')
        }
      "
    >
      Connect
    </button>
    <button
      @click="
        () => {
          emits('learnMore')
        }
      "
      style="background: transparent; color: #d9fc01; display: block; margin: 0 auto"
    >
      Learn More
    </button>
  </div>
</template>
<script setup lang="ts">
  import Create from '../Icons/Create.vue'
  import Connect from '../Icons/Connect.vue'
  import type { WalletConnector } from '../../wallets/useWalletConnectors'

  withDefaults(
    defineProps<{
      wallet: WalletConnector
    }>(),
    {}
  )
  const emits = defineEmits(['connect', 'learnMore'])
</script>
